<?php $this->_extends('../_layouts/blank_layout'); ?>
<?php $this->_block('contents'); ?>
<script type="text/javascript" src="<?=Q::ini('custom_system/base_url')?>js/jq.js"></script>
<link type="text/css" href="<?=Q::ini('custom_system/base_url')?>css/prettyphoto.css" rel="stylesheet" />
<script type="text/javascript" src="<?=Q::ini('custom_system/base_url')?>js/jq.prettyphoto.js"></script>
<script type="text/javascript">
$(function(){
	$("a[rel^='pretty_photo']").prettyPhoto({theme:'facebook'});
});
</script>
<?if ( ! empty($warehouse_allocate['item'])):?>
<table class="table_form">
	<tr>
		<th align="right">调拨单号</th>
		<td><h3><?=$warehouse_allocate['number']?></h3></td>
		<th align="right">制单人员</th>
		<td><?=$warehouse_allocate['make_user_name']?></td>
	</tr>
	<tr>
		<th align="right">起始仓出库时间</th>
		<td><?=$warehouse_allocate['confirm_time']?></td>
		<th align="right">制单日期</th>
		<td><?=$warehouse_allocate['make_time']?></td>
	</tr>
	<tr>
		<th align="right">调返起始仓时间</th>
		<td><?=$warehouse_allocate['return_time']?></td>
		<th align="right">起始仓</th>
		<td><?=$warehouse_allocate['start_warehouse_name']?></td>
	</tr>
	<tr>
		<th align="right">目标仓入库时间</th>
		<td><?=$warehouse_allocate['arrive_time']?></td>
		<th align="right">目标仓</th>
		<td><?=$warehouse_allocate['end_warehouse_name']?></td>
	</tr>
	<tr>
		<th align="right">备注</th>
		<td><textarea rows="3" cols="40" disabled="disabled"><?=$warehouse_allocate['notes']?></textarea></td>
	</tr>
</table><br/>
<table class="list_table" width="100%">
	<tr>
		<th width="130">产品编号</th>
		<th>产品名称</th>
		<th width="100">产品单价</th>
		<th width="80">调配数量</th>
	</tr>
	<?$total_quantity = 0;?>
	<?foreach ($warehouse_allocate['item'] as $w):?>
	<?$total_quantity += $w['quantity'];?>
	<tr>
		<td align="left">
			<?=$w['number']?>
			<?if ($w['pic_url']):?>
				<?$pretty_photo_number = 0;?>
				<?foreach ($w['pic_url'] as $ip):?>
				<a rel="pretty_photo[<?=$ai['id']?>]" href="<?=$ip?>"><?if(!$pretty_photo_number):?><span class="img_icon"></span><?endif;?></a>
				<?$pretty_photo_number = 1;?>
				<?endforeach;?>
			<?endif;?>
		</td>
		<td><?=$w['product_name']?></td>
		<td><?=number_format($w['price'], 2)?></td>
		<td><?=$w['quantity']?></td>
	</tr>
	<?endforeach;?>
	<tr>
		<td colspan="2" align="right"><b>总计：</b></td>
		<td></td>
		<td><?=$total_quantity?></td>
	</tr>
</table>
<?endif;?>
<?php $this->_endblock();?>